package com.xywy.fwc.net;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.xywy.fwc.bean.FwcAssea;
import com.xywy.fwc.bean.FwcHomeData;

public class AsseaParser extends BaseParser<List<ArrayList<FwcAssea>>> {
    
	@Override
	public List<ArrayList<FwcAssea>> parseJson(String result) {
		Gson gson = new Gson();
		List<ArrayList<FwcAssea>> list = new ArrayList<ArrayList<FwcAssea>>();
		try {
			JSONObject json  =new JSONObject(result);
			JSONArray data = json.optJSONArray("data");
			for(int i=0;i<data.length();i++){
				ArrayList<FwcAssea> temp = gson.fromJson(data.get(i).toString(),  new TypeToken<List<FwcAssea>>(){}.getType());
				list.add(temp);
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}finally{
			return list;
		}
	}

}
